import type { RouteRecordRaw } from "vue-router";
import { Guide, Monitor, Sort, Apple, Lock } from "@element-plus/icons-vue";
import { PermissionKeyEnum } from "@/utils";

export default import.meta.env.MODE === "development"
  ? ([
      {
        path: "/test",
        name: "Test",
        meta: {
          title: "测试示例",
          keepAlive: false,
          menu: {
            show: true,
            icon: Guide,
          },
        },
        component: () => import("@/pages/test/Index.vue"),
        children: [
          {
            path: "layout",
            name: "TestLayout",
            meta: {
              title: "布局示例",
              keepAlive: false,
              menu: {
                show: true,
                icon: Monitor,
              },
              layout: {
                breadcrumb: true,
              },
            },
            component: () => import("@/pages/test/layout/Index.vue"),
            children: [
              {
                path: "noHeader",
                name: "NoHeader",
                meta: {
                  title: "布局无header",
                  keepAlive: false,
                  layout: {
                    header: false,
                    breadcrumb: true,
                  },
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/layout/NoHeader.vue"),
              },
              {
                path: "noFooter",
                name: "NoFooter",
                meta: {
                  title: "布局无footer",
                  keepAlive: false,
                  layout: {
                    footer: false,
                    breadcrumb: true,
                  },
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/layout/NoFooter.vue"),
              },
              {
                path: "noSidebar",
                name: "NoSidebar",
                meta: {
                  title: "布局无侧边栏",
                  keepAlive: false,
                  layout: {
                    sidebar: false,
                    breadcrumb: true,
                  },
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/layout/NoSidebar.vue"),
              },
              {
                path: "noBreadcrumb",
                name: "NoBreadcrumb",
                meta: {
                  title: "布局无面包屑",
                  keepAlive: false,
                  layout: {
                    breadcrumb: false,
                  },
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/layout/NoBreadcrumb.vue"),
              },
              {
                path: "noOther",
                name: "NoOther",
                meta: {
                  title: "布局只有主体",
                  keepAlive: false,
                  layout: {
                    header: false,
                    footer: false,
                    sidebar: false,
                  },
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/layout/NoOther.vue"),
              },
            ],
          },
          {
            path: "menu",
            name: "TestMenu",
            meta: {
              title: "菜单示例",
              keepAlive: false,
              menu: {
                show: true,
                icon: Sort,
              },
            },
            component: () => import("@/pages/test/menu/Index.vue"),
            children: [
              {
                path: "page1",
                name: "Page1",
                meta: {
                  title: "页面1",
                  keepAlive: false,
                  menu: {
                    show: true,
                    sort: 1,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/menu/Page1.vue"),
              },
              {
                path: "page2",
                name: "Page2",
                meta: {
                  title: "页面2",
                  keepAlive: false,
                  menu: {
                    show: true,
                    sort: 3,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/menu/Page2.vue"),
              },
              {
                path: "page3",
                name: "Page3",
                meta: {
                  title: "页面3",
                  keepAlive: false,
                  menu: {
                    show: true,
                    sort: 2,
                    icon: Apple,
                  },
                },
                component: () => import("@/pages/test/menu/Page3.vue"),
              },
            ],
          },
          {
            path: "permission",
            name: "TestPermission",
            meta: {
              title: "权限示例",
              keepAlive: false,
              menu: {
                show: true,
                icon: Lock,
              },
            },
            component: () => import("@/pages/test/permission/Index.vue"),
            children: [
              {
                path: "needLogin",
                name: "NeedLogin",
                meta: {
                  title: "需要登录",
                  keepAlive: false,
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                  permission: {
                    login: true,
                    key: PermissionKeyEnum.TEST_PERMISSION_LOGIN,
                  },
                },
                component: () =>
                  import("@/pages/test/permission/NeedLogin.vue"),
              },
              {
                path: "needPermission",
                name: "NeedPermission",
                meta: {
                  title: "需要权限",
                  keepAlive: false,
                  menu: {
                    show: true,
                    icon: Apple,
                  },
                  permission: {
                    key: PermissionKeyEnum.TEST_PERMISSION_PERMISSION,
                  },
                },
                component: () =>
                  import("@/pages/test/permission/NeedPermission.vue"),
              },
            ],
          },
        ],
      },
    ] as RouteRecordRaw[])
  : [];
